package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author GXC
 * @description 角色&权限关联信息新增/修改请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("角色&权限信息新增/修改请求体")
public class RolePermissionSaveVO implements Serializable {

    private static final long serialVersionUID = 3039645087914143139L;

    /**
     * 角色&权限关联id
     */
    @ApiModelProperty("角色&权限关联id")
    @Null(message = "新增角色&权限关联信息: 角色&权限关联id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改角色&权限关联信息: 角色&权限关联id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改角色&权限关联信息: 角色&权限关联id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 角色id
     */
    @ApiModelProperty("角色id")
    @NotNull(message = "角色id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value = 1, message = "角色id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long roleId;

    /**
     * 权限id
     */
    @ApiModelProperty("权限id")
    @NotNull(message = "权限id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value = 1, message = "权限id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long permissionId;

}
